import java.util.Arrays;
/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 晓星航
 * Date: 2022-10-14
 * Time: 11:37
 */
public class TestDemo {
    public static void print(int[] array) {
        for (int i = 0; i < array.length; i++) {
            System.out.print(array[i]+" ");
        }
    }
    public static void main(String[] args) {
        int[] array = {1,2,3,4,5,6,7,8,9};
        print(array);
    }
    public static void main3(String[] args) {
        int[] array2 = null;//这个引用 不指向 任何的对象
        System.out.println(array2.length);
        int[] arr = null;
        System.out.println(arr[0]);
    }
    public static void printArray(int[] a) {
        for (int x : a) {
            System.out.println(x);
        }
    }
    public static void main2(String[] args) {
            int[] arr = {1, 2, 3};
            printArray(arr);
            String ret = Arrays.toString(arr);
        System.out.println(ret);
    }
    public static void main1(String[] args) {
        int[] array = {1,2,3,4,5,6,7,8,9,10};
        for (int x:array
             ) {
            System.out.print(x+" ");
        }
        System.out.println();
        char[] arr = {'黄','能','是','个','大','傻','子'};
        for (char x:arr
             ) {
            System.out.print(x);
        }
    }
}
